﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="AddPosts.aspx.vb" Inherits="Nokia_Smartphones.AddPosts" %>



<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .discussionInformation
        {
            height: 1203px;
        }
        .x6Image
        {
            width: 312px;
            height: 126px;
            text-align: center;
        }
        .addNewPosts
        {
            height: 122px;
        }
        .postsUnedited
        {
            height: 883px;
        }
        .posts
        {
            height: 199px;
        }
        .RateButton
        {
            height: 96px;
        }
        .style3
        {
            float: right;
            width: 312px;
            height: 126px;
            text-align: center;
            font-size: large;
        }
        .AverageRatingPostsAdd
        {
            height: 97px;
        }
        
        .st
        {
            font-size: medium;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Maintenance Forum - <em>Leave a reply...</em>
    </h2>
    <div class="discussionInformation">
        <div class="posts">
            <asp:FormView ID="FormView1" runat="server" DataKeyNames="Maintenance_ID" DataSourceID="SqlDataSource2"
                Width="869px" Font-Bold="True" Font-Italic="True" Font-Size="Large" ForeColor="Red"
                Height="81px">
                <EditItemTemplate>
                    
                    <br />
                    Title:
                    <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                    <br />
                    <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"
                        Text="Update" />
                    &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False"
                        CommandName="Cancel" Text="Cancel" />
                </EditItemTemplate>
                <InsertItemTemplate>
                    Title:
                    <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                    <br />
                    <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"
                        Text="Insert" />
                    &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"
                        CommandName="Cancel" Text="Cancel" />
                </InsertItemTemplate>
                <ItemTemplate>
                    
                    <br />
                    Title:
                    <asp:Label ID="TitleLabel" runat="server" Text='<%# Bind("Title") %>' />
                    <br />
                </ItemTemplate>
            </asp:FormView>
            <br />
            <div>
                <strong><em>Your Rating </em></strong>
                <asp:Rating ID="Rating1" runat="server" Width="129px" Height="40px" EmptyStarCssClass="emptyRatingStar"
                    FilledStarCssClass="filledRatingStar" StarCssClass="ratingStar" 
                    WaitingStarCssClass="savedRatingStar" CurrentRating="1">
                </asp:Rating>
            </div>
            <div class="RateButton">
                <asp:Button ID="btnRate" runat="server" Height="34px" Text="Rate" Width="55px" 
                    CssClass="buttons" />
            </div>
        </div>
        <br />
        <div class="posts100">
            <strong><em>Leave A Reply.
        </em></strong>
        </div>
        <br />
        <div class="addNewPosts">
            <div class="style3">
                <strong>User Rating<br />
                    <div class="AverageRatingPostsAdd">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Label ID="lblAverageRatings" runat="server" Text="Label" Font-Size="Medium"
                            BorderStyle="Inset" Width="57px" Style="text-decoration: underline"></asp:Label>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        
                    </div>
                </strong>
            </div>
            <span class="st">
                <asp:TextBox ID="txtpost" runat="server" BorderStyle="Solid" Height="94px" TextMode="MultiLine"
                    Width="434px" BorderColor="Silver" CssClass="textboxnormal"></asp:TextBox>
                &nbsp;<asp:Button ID="btnpost" runat="server" Height="31px" Text="Reply" 
                Width="64px" CssClass="buttons" />
                <br />
            </span>
        </div>
        <div class="postsUnedited">
            <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" Style="font-family: Calibri;
                font-size: small">
                <AlternatingItemTemplate>
                    <li style="background-color: #FFFFFF;color: #284775;">PostBody:
                        <asp:Label ID="PostBodyLabel" runat="server" Text='<%# Eval("PostBody") %>' />
                        <br />
                        DatePosted:
                        <asp:Label ID="DatePostedLabel" runat="server" 
                            Text='<%# Eval("DatePosted") %>' />
                        <br />
                        TimePosted:
                        <asp:Label ID="TimePostedLabel" runat="server" 
                            Text='<%# Eval("TimePosted") %>' />
                        <br />

                    
                        UserName:
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                        <br />
                    </li>
                </AlternatingItemTemplate>
                <EditItemTemplate>
                    <li style="background-color: #999999;">PostBody:
                        <asp:TextBox ID="PostBodyTextBox" runat="server" 
                            Text='<%# Bind("PostBody") %>' />
                        <br />
                        DatePosted:
                        <asp:TextBox ID="DatePostedTextBox" runat="server" 
                            Text='<%# Bind("DatePosted") %>' />
                        <br />
                        TimePosted:
                        <asp:TextBox ID="TimePostedTextBox" runat="server" 
                            Text='<%# Bind("TimePosted") %>' />
                        <br />
                        
                        <br />
                       
                        UserName:
                        <asp:TextBox ID="UserNameTextBox" runat="server" 
                            Text='<%# Bind("UserName") %>' />
                        <br />
                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                            Text="Update" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Cancel" />
                    </li>
                </EditItemTemplate>
                <EmptyDataTemplate>
                    No data was returned.
                </EmptyDataTemplate>
                <InsertItemTemplate>
                    <li style="">PostBody:
                        <asp:TextBox ID="PostBodyTextBox" runat="server" 
                            Text='<%# Bind("PostBody") %>' />
                        <br />
                        DatePosted:
                        <asp:TextBox ID="DatePostedTextBox" runat="server" 
                            Text='<%# Bind("DatePosted") %>' />
                        <br />
                        TimePosted:
                        <asp:TextBox ID="TimePostedTextBox" runat="server" 
                            Text='<%# Bind("TimePosted") %>' />
                        <br />
                       
                        UserName:
                        <asp:TextBox ID="UserNameTextBox" runat="server" 
                            Text='<%# Bind("UserName") %>' />
                        <br />
                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                            Text="Insert" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Clear" />
                    </li>
                </InsertItemTemplate>
                <ItemSeparatorTemplate>
                    <br />
                </ItemSeparatorTemplate>
                <ItemTemplate>
                    <li style="background-color: #E0FFFF;color: #333333;">PostBody:
                        <asp:Label ID="PostBodyLabel" runat="server" Text='<%# Eval("PostBody") %>' />
                        <br />
                        DatePosted:
                        <asp:Label ID="DatePostedLabel" runat="server" 
                            Text='<%# Eval("DatePosted") %>' />
                        <br />
                        TimePosted:
                        <asp:Label ID="TimePostedLabel" runat="server" 
                            Text='<%# Eval("TimePosted") %>' />
                        <br />
                                              
                        UserName:
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                        <br />
                    </li>
                </ItemTemplate>
                <LayoutTemplate>
                    <ul ID="itemPlaceholderContainer" runat="server" 
                        style="font-family: Verdana, Arial, Helvetica, sans-serif;">
                        <li runat="server" id="itemPlaceholder" />
                    </ul>
                    <div style="font-family: Verdana, Arial, Helvetica, sans-serif; text-align: center; background-color: #5D7B9D; color: #FFFFFF;">
                    </div>
                </LayoutTemplate>
                <SelectedItemTemplate>
                    <li style="background-color: #E2DED6;font-weight: bold;color: #333333;">PostBody:
                        <asp:Label ID="PostBodyLabel" runat="server" Text='<%# Eval("PostBody") %>' />
                        <br />
                        DatePosted:
                        <asp:Label ID="DatePostedLabel" runat="server" 
                            Text='<%# Eval("DatePosted") %>' />
                        <br />
                        TimePosted:
                        <asp:Label ID="TimePostedLabel" runat="server" 
                            Text='<%# Eval("TimePosted") %>' />
                        <br />
                        
                        
                        UserName:
                        <asp:Label ID="UserNameLabel" runat="server" Text='<%# Eval("UserName") %>' />
                        <br />
                    </li>
                </SelectedItemTemplate>
            </asp:ListView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:PhonesConn %>"
                ProviderName="<%$ ConnectionStrings:PhonesConn.ProviderName %>" 
                SelectCommand="SELECT Posts.PostBody, Posts.DatePosted, Posts.TimePosted, Posts.MaintenanceFkID, Posts.PostID, aspnet_Users.UserName FROM (Posts INNER JOIN aspnet_Users ON Posts.UserIDFK = aspnet_Users.UserId) WHERE (Posts.MaintenanceFkID = ?) ORDER BY Posts.PostID DESC">
                <SelectParameters>
                    <asp:QueryStringParameter Name="DiscussionIDFK" QueryStringField="id" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:PhonesConn %>"
                ProviderName="<%$ ConnectionStrings:PhonesConn.ProviderName %>" 
                SelectCommand="SELECT [Maintenance_ID], [Title] FROM [Maintenance] WHERE ([Maintenance_ID] = ?)">
                <SelectParameters>
                    <asp:QueryStringParameter Name="DiscussionID" QueryStringField="id" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>
            <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
            </asp:ToolkitScriptManager>
        </div>
</asp:Content>
